﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PersonalAlbum.Exceptions;

namespace MyAlbum.Utility
{
    public static class Assert
    {
        /// <summary>
        /// Validate that a value is not null
        /// </summary>
        /// <param name="value">The value to check</param>
        /// <exception cref="AssertionException"></exception>
        public static void IsNotNull(object value)
        {
            IsNotNull(value, "Required parameter");
        }

        /// <summary>
        /// Validate that a value is not null
        /// </summary>
        /// <param name="value">The value to check</param>
        /// <param name="paramName">The name of the parameter</param>
        /// <exception cref="AssertionException"></exception>
        public static void IsNotNull(object value, string paramName)
        {
            if (value == null)
            {
                throw new AssertionException(paramName + " is null, which is not allowed");
            }
        }
    }
   
}
